/*
 *  Copyright (C) 2011 felixtheripper <felixtheripper_AT_gmail.com>
 *
 *  This program is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU General Public License
 *  as published by the Free Software Foundation; either version 2
 *  of the License, or (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

package org.myorg.ctm.etk.gui.swg.display.optionpane;

import java.awt.Component;
import javax.swing.Icon;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import org.myorg.ctm.etk.gui.swg.util.property.PrpNamingEtk;
import org.myorg.ctm.etk.naming.NmgFrench;

/**
 *
 * @author felixtheripper
 *
 * email: felixtheripper_AT_gmail.com
 * ... please remove "_AT_" from the above string to get the right email address
 *
 */

abstract public class OptionPaneChoiceEtk extends JOptionPane
{
    // trick
    private OptionPaneChoiceEtk()
    {
        super();
    }

    static public String showDialogUser(JFrame frmParent)
    {
        Object[] objsChoice = {
            NmgFrench.F_STR_NAME_PRACTITIONER,
            NmgFrench.F_STR_NAME_SECRETARY};

        return OptionPaneChoiceEtk._showDialog(frmParent, objsChoice, "New User");
    }


    static private String _showDialog(
            JFrame frmParent,
            Object[] objsChoice,
            String strTitleSuffix)
    {

        Object objMessage = "Please select from list:\n\n";
        String strTitle = System.getProperty(PrpNamingEtk.STR_PRP_APPLI_TITLE) + " - " + strTitleSuffix;

        
        String strResult = (String) JOptionPane.showInputDialog(
                    (Component) frmParent,
                    objMessage,
                    strTitle,
                    JOptionPane.QUESTION_MESSAGE,
                    (Icon) null,
                    objsChoice,
                    objsChoice[0]);

        return strResult;
    }

    static public String showDialogItem(JFrame frmParent)
    {
        Object[] objsChoice = {
            NmgFrench.F_STR_NAME_CLIENT,
            NmgFrench.F_STR_NAME_ANIMAL};

        return OptionPaneChoiceEtk._showDialog(frmParent, objsChoice, "New Item");
    }


}
